<!DOCTYPE html>
<html>
  <head>
    <title>index.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
    查找用户名：<input type="text" id="name"><button type="button" onclick="select()">确定</button><br/>
    <form action="${path}/index/add" method="post">
    <button type="submit" >增加用户</button> 
    </form>
    
  
  <script type="text/javascript" src="${path}/js/jquery.min.js"></script>
  <script>
   function select(){
            	alert("1111");
            var name =	document.getElementById("name").value;
            alert(name);
            $.ajax({
          	  		type:"post",
                    url:'${path}/index/select',
                    datatype:"json",
                    data:{
                            name:name,
                    },
                   success:function(data){
                  	 alert("成功");
                  	 window.location.href="${path}/user/listUser?name="+name;
           			 },error:function(data){
           			 /*没有该名字  */
           			 alert("无该用户。");}
            });
                    }
  </script>
  </body>
</html>
